bitkeeper revision 1.1236.1.197 (424e4a83Uiv2R3w5XZIvsLYfRc7fhQ)
authorleendert@watson.ibm.com[kaf24] <leendert@watson.ibm.com[kaf24]>
Sat, 2 Apr 2005 07:32:19 +0000 (07:32 +0000)
committerleendert@watson.ibm.com[kaf24] <leendert@watson.ibm.com[kaf24]>
Sat, 2 Apr 2005 07:32:19 +0000 (07:32 +0000)
[PATCH] [PATCH] tools/libxc/xc_vmx_build.c broken

xc_vmx_build pins the level 2 page table too early so that subsequent maps
(like those in zap_mmio_ranges) fail and consequently xc_vmx_build fails.
To solve this, this patch pins the l2pt at the end of the function when
all memory initializations are finalized.

Signed-off-by: Leendert van Doorn <leendert@watson.ibm.com>
BitKeeper/etc/logging_ok
tools/libxc/xc_vmx_build.c

index fb88f12f887c220b529f41021ca4881d267bf531..329e97523d0208ed01a38b893a6f83bd9b2cbc52 100644 (file)
@@ -52,6 +52,7 @@ kaf24@striker.cl.cam.ac.uk
 kaf24@viper.(none)
 kmacy@shemp.lab.netapp.com
 laudney@eclipse.(none)
+leendert@watson.ibm.com
 lynx@idefix.cl.cam.ac.uk
 maf46@burn.cl.cam.ac.uk
 mafetter@fleming.research
index d1692e61f80e30f96c6cad6cb7c62e09b8ad9b07..ed9868e9f0ee20fe76f5e07ab644e1a8189b599a 100644 (file)
@@ -329,13 +329,6 @@ static int setup_guest(int xc_handle,
     munmap(vl1tab, PAGE_SIZE);
     munmap(vl2tab, PAGE_SIZE);
 
-    /*
-     * Pin down l2tab addr as page dir page - causes hypervisor to provide
-     * correct protection for the page
-     */ 
-    if ( pin_table(xc_handle, MMUEXT_PIN_L2_TABLE, l2tab>>PAGE_SHIFT, dom) )
-        goto error_out;
-
     if ((boot_paramsp = xc_map_foreign_range(
                xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE,
                page_array[(vboot_params_start-dsi.v_start)>>PAGE_SHIFT])) == 0)
@@ -428,6 +421,13 @@ static int setup_guest(int xc_handle,
         shared_info->vcpu_data[i].evtchn_upcall_mask = 1;
     munmap(shared_info, PAGE_SIZE);
 
+    /*
+     * Pin down l2tab addr as page dir page - causes hypervisor to provide
+     * correct protection for the page
+     */ 
+    if ( pin_table(xc_handle, MMUEXT_PIN_L2_TABLE, l2tab>>PAGE_SHIFT, dom) )
+        goto error_out;
+
     /* Send the page update requests down to the hypervisor. */
     if ( finish_mmu_updates(xc_handle, mmu) )
         goto error_out;